﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebApplication1.ServiceReference1;
using System.Data.Services.Client;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        private Uri serviceUri = new Uri("http://localhost:50000/FootballService.svc/");
        WebApplication1.ServiceReference1.FotbalEntities context;
        protected void Page_Load(object sender, EventArgs e)
        {
            context = new WebApplication1.ServiceReference1.FotbalEntities(serviceUri);
            if (!IsPostBack)
            {               
                BindEchipe();
            }

        }
       
        private void BindEchipe()
        {
            DataServiceQuery<Echipe> echipe =
            context.CreateQuery<Echipe>("/Echipes");

            var query = from e in echipe
                        select e;

            ListView_ListaEchipeMenu.DataSource = query;
            ListView_ListaEchipeMenu.DataBind();
        }
    }
}
